/**
 *  @file SDLHighScoreSection.h
 *
 *  @date 21-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef SDLHIGHSCORESECTION_H_
#define SDLHIGHSCORESECTION_H_

#include <tr1/memory>
#include "SDLApplicationSection.h"
#include "SDLApplication.h"
#include "SDLStaticRepresentation.h"
#include "SDLImageRepresentation.h"
#include "SDLWindow.h"
#include "SDLInputField.h"
#include "SDLTextRepresentation.h"
#include "highScoreController.h"


namespace si_sdl
{
/**
 * When the mode of the highscoresection is ENTERING, a new entry is being entered.
 * When the mode is VIEWING, we're readonly viewing old highscores.
 */
enum HighScoreMode { ENTERING, VIEWING };

/**
 * Section the app will be in when viewing or entering highscores. This will use
 * a highscorecontroller.
 */
class SDLHighScoreSection: public si_sdl::SDLApplicationSection
{
public:
	SDLHighScoreSection(SDLApplication& parent, SDLWindow& win);
	virtual ~SDLHighScoreSection();

	virtual void newFrame(double timeSinceLastFrame);
	virtual void onSDLEvent(SDL_Event& event);

	virtual void youreStarting();

private:

	std::tr1::shared_ptr<si::HighScoreController> fController;
	std::tr1::shared_ptr<SDLTextRepresentation> fHeader;
	std::tr1::shared_ptr<SDLTextRepresentation> fEnterName;
	std::tr1::shared_ptr<SDLInputField> fInputField;

	HighScoreMode fMode;


};

}

#endif /* SDLSPLASHSECTION_H_ */
